
// 设置全局的页面样式
const state = {
  drawerState: false, // 是否面板关闭
  asideColor: '#5F4B8B', // 左侧导航背景颜色
  aTextColor: '#FFFFFF', // 左侧导航文字颜色
  aActiveColor: '#ff6600', // 左侧导航文字选中颜色
  headerBColor: '#5F4B8B', // 头部背景颜色
  headerColor: '#FFFFFF', // 头部文字颜色
  doubleOpen: true // 左侧导航菜单是否只打开一个菜单
}

const getters = {
  openDrawer: state => {
    return state.drawerState
  },
  AsideColor: state => {
    return state.asideColor
  },
  ATextColor: state => {
    return state.aTextColor
  },
  ActiveColor: state => {
    return state.aActiveColor
  },
  HeaderBColor: state => {
    return state.headerBColor
  },
  HeaderColor: state => {
    return state.headerColor
  },
  DoubleOpen: state => {
    return state.doubleOpen
  }
}

const mutations = {
  asideChange (state, changeColor) {
    state.asideColor = changeColor
  },
  textChange (state, changeColor) {
    state.aTextColor = changeColor
  },
  activeChange (state, changeColor) {
    state.aActiveColor = changeColor
  },
  headerBChange (state, changeColor) {
    state.headerBColor = changeColor
  },
  headerChange (state, changeColor) {
    state.headerColor = changeColor
  },
  valueChange (state, changeValue) {
    state.doubleOpen = changeValue
  },
  setDrawerState (state, value) {
    state.drawerState = value
  }
}

export default {
  namespaced: true,
  state,
  getters,
  mutations
}
